/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.cggveritas.crewintranet.jms.entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import org.codehaus.jackson.annotate.JsonIgnore;

/**
 *
 * @author Alassane
 */
@Entity
@Table(name = "cv_typeevaluationvehicule")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CvTypeevaluationvehicule.findAll", query = "SELECT c FROM CvTypeevaluationvehicule c"),
    @NamedQuery(name = "CvTypeevaluationvehicule.findByIdtypeevaluation", query = "SELECT c FROM CvTypeevaluationvehicule c WHERE c.idtypeevaluation = :idtypeevaluation"),
    @NamedQuery(name = "CvTypeevaluationvehicule.findByTypeevaluationve", query = "SELECT c FROM CvTypeevaluationvehicule c WHERE c.typeevaluationve = :typeevaluationve")})
public class CvTypeevaluationvehicule implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idtypeevaluation")
    private Integer idtypeevaluation;
    @Basic(optional = false)
    @Column(name = "typeevaluationve")
    private String typeevaluationve;
    @Lob
    @Column(name = "commentaire")
    private String commentaire;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "cvTypeevaluationvehiculeIdtypeevaluation", fetch = FetchType.LAZY)
    private List<CvEvaluationvehicule> cvEvaluationvehiculeList;

    public CvTypeevaluationvehicule() {
    }

    public CvTypeevaluationvehicule(Integer idtypeevaluation) {
        this.idtypeevaluation = idtypeevaluation;
    }

    public CvTypeevaluationvehicule(Integer idtypeevaluation, String typeevaluationve) {
        this.idtypeevaluation = idtypeevaluation;
        this.typeevaluationve = typeevaluationve;
    }

    public Integer getIdtypeevaluation() {
        return idtypeevaluation;
    }

    public void setIdtypeevaluation(Integer idtypeevaluation) {
        this.idtypeevaluation = idtypeevaluation;
    }

    public String getTypeevaluationve() {
        return typeevaluationve;
    }

    public void setTypeevaluationve(String typeevaluationve) {
        this.typeevaluationve = typeevaluationve;
    }

    public String getCommentaire() {
        return commentaire;
    }

    public void setCommentaire(String commentaire) {
        this.commentaire = commentaire;
    }

    @XmlTransient
    @JsonIgnore
    public List<CvEvaluationvehicule> getCvEvaluationvehiculeList() {
        return cvEvaluationvehiculeList;
    }

    public void setCvEvaluationvehiculeList(List<CvEvaluationvehicule> cvEvaluationvehiculeList) {
        this.cvEvaluationvehiculeList = cvEvaluationvehiculeList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idtypeevaluation != null ? idtypeevaluation.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CvTypeevaluationvehicule)) {
            return false;
        }
        CvTypeevaluationvehicule other = (CvTypeevaluationvehicule) object;
        if ((this.idtypeevaluation == null && other.idtypeevaluation != null) || (this.idtypeevaluation != null && !this.idtypeevaluation.equals(other.idtypeevaluation))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fr.cggveritas.crewintranet.jms.entities.CvTypeevaluationvehicule[ idtypeevaluation=" + idtypeevaluation + " ]";
    }
    
}
